package rsj.api.product.usgae;

import com.rlyy.aibase.utils.base.Box;
import com.rlyy.aibase.utils.base.MapNode;
import common.util.BoxUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import rsj.api.org.entity.UsageReportParam;
import rsj.api.user.BaseLink;
import rsj.service.usage.IUsageTemplateMethod;

/**
 * 产品管理-客户线下测试使用情况
 *
 * @author yuanqinglong
 * @since 2021/3/4 10:49
 */
@RestController
public class OfflineTestingUsageReportController extends BaseLink {

    @Autowired
    private IUsageTemplateMethod usageReportForProduct;

    /**
     * 产品管理-客户线下测试使用情况
     *
     * @param in 参数
     * @return 线下测试数据列表
     */
    @Override
    @RequestMapping(name = "rsj_product_offline_usage_report")
    public Box executeLink(Box in) {
        MapNode mapNode = usageReportForProduct.usageReport(in, IUsageTemplateMethod.OFFLINE_ENVIRONMENT, UsageReportParam.ProdUidNotNull.class, UsageReportParam.Pagination.class);
        return BoxUtil.successBox(in).putMapNode("data", mapNode);
    }
}
